const arr = [1,2,3,4];
arr.reduce(
    (prev,curr) => {
        return prev+curr
    }
)